package com.gao.service.impl;

import java.sql.SQLException;
import java.util.List;

import com.gao.dao.ProductDao;
import com.gao.dao.impl.ProductDaoImpl;
import com.gao.domain.Product;
import com.gao.service.ProductService;


public class ProductServiceImpl implements ProductService{
	ProductDao  pdi = new ProductDaoImpl();
	@Override
	public List<Product> getAllProducts()  {
		try {
			return pdi.findAllProducts();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}
	@Override
	public Product findProductById(int id)  {
		try {
			return pdi.findProductById(id);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}
	@Override
	public boolean outProductById(int pid, int num)  {
		// TODO Auto-generated method stub
		try {
			return pdi.outProductById(pid, num);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;
	}
	
	
	
}
